package com.gzs.learn.springcloud.service;


import com.gzs.learn.springcloud.dto.AddressDto;
import com.gzs.learn.springcloud.dto.UserDto;
import com.gzs.learn.springcloud.entity.Address;
import com.gzs.learn.springcloud.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;
import java.util.Optional;
import java.util.Set;

public interface IUserService {
    Optional<UserDto> findByUserId(Long userId);

    Optional<User> getUser(Long userId);

    List<User> findAllByIds(Set<Long> userIds);

    Optional<User> saveUser(User user);

    Optional<Address> saveAddress(Address address);

    List<Address> saveBatchAddreass(List<Address> addresses);

    Page<AddressDto> findAllByUserId(long userId, Pageable pageable);

    Optional<UserDto> findByUserAndAddress(Long userId, Long addressId);
}
